package cn.edu.zafu.bigdata.LiJuan;

import cn.hutool.core.date.DateTime;

import java.time.LocalTime;

public class MyThreadDemo {
    public static void main(String[] args) {
        Thread t=new MyThread2();
        t.setDaemon(true);
        t.start();
        Thread t2=new Thread(new Mythread());

        t2.start();


    }
}
class MyThread2 extends Thread{
    @Override
    public void run(){
        //DateTime dt=new DateTime();
        while (true) {
            System.out.println(LocalTime.now());
            try {
                Thread.sleep(100);
            }catch(InterruptedException e){
                throw new RuntimeException(e);
            }
        }
    }
}

class Mythread implements Runnable{
    @Override
    public void run() {
        int count=0;
        while(count++<100){
            System.out.println(count);
            try{
                Thread.sleep(100);
            }catch(InterruptedException e){
                throw new RuntimeException(e);
            }
        }
    }
}

